<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>

<html>
<head>
<script type="text/javascript" >



</script>

<script type="text/javascript">
var productStatusJson;  
$(document).ready(function () {         
	
})


/**
 * 保存页面数据
 */
 function saveproduct() {
	
    //将数据保存到数据库中
    $.ajax({
    	 url: "rest/product/save.do",
    	 type:'post',
    	 data: { "productNo":$("#productNo").val() },  	 
    	 success:function (data){
    		 
      		 //返回到默认选中展示目录
      		 parent.showCenter('product/index.do');
      		 
      		//'http://'+host+'/productApi/addPhoto'
      	}

    	 });
} 
/**
 * 返回页面
 */
function back(url){
	$.get(url, {}, function(data){
		$("#center").empty();
        $("#center").html(data);
        $.parser.parse($("#center"));
    });
}
function saveProduct() {
    $('#product-fm').form('submit', {
        url: 'rest/product/add.do',        
        onSubmit: function (identificationCard) {
        	
        },
        success: function (result) {
        	$.messager.progress('close'); 
            var result = eval('(' + result + ')');
            if (result.retCode=='0000') {
            	back('product/index.do');
                
            } else {
                $.messager.show({
                    title: 'Error',
                    msg: result.retMsg
                });
            }
        }
    });
}
</script>
</head>
<body>
		
<div class="linkbar"><a> 排班管理</a>/<a> 排班录入</a></div>
		<form id="product-fm" method="post" novalidate>
			<div class="fitem">
				<label>产品名:</label> <input name="productName"
					class="easyui-validatebox" missingMessage="该输入项不能为空！"
					required="true" validType="mobile"/>
			</div>

			<div class="fitem">
				<label>版本:</label> <input name="version"
					class="easyui-validatebox" missingMessage="该输入项不能为空！"
					required="true" />
			</div>
			<div class="fitem">
				<label>产品key:</label> <input name="productKey"
					class="easyui-validatebox" missingMessage="该输入项不能为空！"
					required="true" />
			</div>
		</form>
</div>
		
<div id="dlg-buttons">
			<a href="#" class="easyui-linkbutton" iconCls="icon-ok" 	onclick="saveProduct()">保存</a> 
			<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="back('product/index.do')">返回</a>
</div>
		

</body>
</html>